package org.association.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.association.dao.OrganizationDao;
import org.association.entity.OrgUserStats;
import org.association.entity.OrganizationEntity;
import org.association.service.OrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;



@Service
public class OrganizationServiceImpl extends ServiceImpl<OrganizationDao, OrganizationEntity> implements OrganizationService {

    @Autowired
    private OrganizationDao organizationDao;

    @Override
    public boolean addMember(Integer organizationID, String privateKey) {
        return organizationDao.addMember(organizationID, privateKey);
    }

    @Override
    public int quitMember(Integer organizationID, String privateKey) {
        return organizationDao.quitMember(organizationID, privateKey);
    }

    @Override
    public boolean userOrgExist(String privateKey) {
        return organizationDao.userOrgExist(privateKey);
    }

    @Override
    public List<String> getUsersByOrganizationID(Integer organizationID) {
        return organizationDao.getUsersByOrganizationID(organizationID);
    }

    @Override
    public List<OrgUserStats> getOrgUserStats() {
        return organizationDao.getOrgUserStats();
    }

    @Override
    public Integer getOrgIdByPrimaryKey(String primaryKey) {
        return organizationDao.getOrgIdByPrimaryKey(primaryKey);
    }
}